<template>
	<view class="ad-ct">
		<swiper class="swiper gold-dot" style="height: 240rpx;" circular :indicator-dots="true" :autoplay="true" :interval="5000"
		 :duration="1000">
			<swiper-item v-for="i in ads" :key="i.id" @click="$goto(i.url)">
				<view class="swiper-item">
					<image :src="i.img_url" style="width: 670rpx;height: 180rpx;border-radius: 8rpx;" mode=""></image>
				</view>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ads: []
			};
		},
		mounted() {
			this.getAd()
		},
		methods: {
			getAd() {
				this.$u.get('/ad/list', {
					type: 'index'
				}).then(res => {
					this.ads = res.data.result.ad
				})
			}
		}
	}
</script>

<style lang="scss">
	.ad-ct {
		width: 670rpx;
		height: 240rpx;
		margin: 0 auto;
		margin-top: 32rpx;
	}
</style>